#pragma strict
//////////////////////////////////////////////////////
///fps,累积方式.
//////////////////////////////////////////////////////
private var fps:int;

function Start(){
	if(!guiText){
		gameObject.AddComponent(GUIText);
	}
	transform.position = Vector3(0.9,0.05);
	guiText.material.color = Color.red;
	
	InvokeRepeating("Show",0,1);
}

function Show(){
	if(guiText){
		guiText.text = "fps:"+fps;
		fps = 0;
	}
}

function Update () {
	++fps;
}